\hypertarget{spi_8c}{
\section{spi.c File Reference}
\label{spi_8c}\index{spi.c@{spi.c}}
}
Contains all functions for using the SPI interface.  


{\tt \#include \char`\"{}spi.h\char`\"{}}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{spi_8c_4454f968b2402a0e61deb15ab2571dab}{init\_\-spi} (void)
\begin{CompactList}\small\item\em Initializes the SPI interface by configuring various registers. \item\end{CompactList}\item 
void \hyperlink{spi_8c_0e4372da583445375837a70ca231d30f}{send\_\-byte\_\-to\_\-spi} (uint8\_\-t byte)
\begin{CompactList}\small\item\em Sends a byte through the SPI. \item\end{CompactList}\item 
void \hyperlink{spi_8c_d2841531cdcf8bf06556c0281eb306a1}{send\_\-word\_\-to\_\-spi} (uint16\_\-t word)
\begin{CompactList}\small\item\em Sends a 16bit word via SPI. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Contains all functions for using the SPI interface. 

\hyperlink{spi_8c_4454f968b2402a0e61deb15ab2571dab}{init\_\-spi()} must be called before the SPI can be used. Once initialized 16bit words can be sent with the send\_\-word function.

\begin{Desc}
\item[Author:]Peter Kalauskas \end{Desc}
\begin{Desc}
\item[Date:]Feb 1, 2009 \end{Desc}
\begin{Desc}
\item[Version:]1 \end{Desc}


\subsection{Function Documentation}
\hypertarget{spi_8c_4454f968b2402a0e61deb15ab2571dab}{
\index{spi.c@{spi.c}!init\_\-spi@{init\_\-spi}}
\index{init\_\-spi@{init\_\-spi}!spi.c@{spi.c}}
\subsubsection[{init\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-spi (void)}}
\label{spi_8c_4454f968b2402a0e61deb15ab2571dab}


Initializes the SPI interface by configuring various registers. 

\begin{Desc}
\item[Returns:]void \end{Desc}
\hypertarget{spi_8c_0e4372da583445375837a70ca231d30f}{
\index{spi.c@{spi.c}!send\_\-byte\_\-to\_\-spi@{send\_\-byte\_\-to\_\-spi}}
\index{send\_\-byte\_\-to\_\-spi@{send\_\-byte\_\-to\_\-spi}!spi.c@{spi.c}}
\subsubsection[{send\_\-byte\_\-to\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void send\_\-byte\_\-to\_\-spi (uint8\_\-t {\em byte})}}
\label{spi_8c_0e4372da583445375837a70ca231d30f}


Sends a byte through the SPI. 

This function must {\em never\/} be called outside the send\_\-word function.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em byte}]The byte to be sent \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}
\hypertarget{spi_8c_d2841531cdcf8bf06556c0281eb306a1}{
\index{spi.c@{spi.c}!send\_\-word\_\-to\_\-spi@{send\_\-word\_\-to\_\-spi}}
\index{send\_\-word\_\-to\_\-spi@{send\_\-word\_\-to\_\-spi}!spi.c@{spi.c}}
\subsubsection[{send\_\-word\_\-to\_\-spi}]{\setlength{\rightskip}{0pt plus 5cm}void send\_\-word\_\-to\_\-spi (uint16\_\-t {\em word})}}
\label{spi_8c_d2841531cdcf8bf06556c0281eb306a1}


Sends a 16bit word via SPI. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em word}]The 16 bit word to be sent. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}
